[Console] Fix method suggestion order#270787
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Pins Monaco HTTP method completion ordering so safer verbs appear first (GET) and destructive verbs appear last (DELETE), avoiding Monaco’s alphabetical fallback behavior.
Changes:
- Reorders the HTTP method list and adds explicit
sortTextto each completion item. - Adds a unit test that validates Monaco-style sorting puts
GETfirst andDELETElast.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/platform/plugins/shared/console/public/application/containers/editor/utils/autocomplete_utils.ts | Adds explicit sortText and updates canonical HTTP method order for completions |
| src/platform/plugins/shared/console/public/application/containers/editor/monaco_editor_actions_provider.test.ts | Adds focused test for method suggestion ordering using sortText |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Pinging @elastic/kibana-management (Team:Kibana Management) |
342b4c2 to
7a831dc
Compare
SoniaSanzV
left a comment
There was a problem hiding this comment.
tested locally, lgtm! (great improvement, btw!)
Co-authored-by: Cursor <cursoragent@cursor.com>
7a831dc to
ffcc6f8
Compare
💛 Build succeeded, but was flaky
Failed CI Steps
Test Failures
Metrics [docs]Async chunks
History
|
Closes elastic#259251 ## Summary - Pins Console HTTP method completion ordering with explicit `sortText` values so Monaco does not fall back to alphabetical label sorting. - Keeps the existing method set unchanged while ordering `GET` first and `DELETE` last. ## Root Cause - Monaco uses `sortText` for completion ordering and falls back to the item label when `sortText` is missing, which can put `DELETE` before safer/default verbs. ## Fix - Assign stable `sortText` values to method completion items based on the intended canonical order. - Add a focused unit test that sorts method suggestions the same way and verifies `GET` is first and `DELETE` is last. ## Before <img width="723" height="466" alt="image" src="https://github.com/user-attachments/assets/faf244b2-4207-483b-acbc-32b148441b18" /> ## After <img width="725" height="437" alt="image" src="https://github.com/user-attachments/assets/782c0c60-6052-4c28-80bc-f45403fa1383" /> ## Test Plan - `node scripts/jest --config=src/platform/plugins/shared/console/jest.config.js src/platform/plugins/shared/console/public/application/containers/editor/monaco_editor_actions_provider.test.ts` — passed. - `node scripts/check_changes.ts` — passed. ## Release Note - Fixes Console autocomplete so `GET` is shown before `DELETE` when suggesting HTTP methods on an empty request line. Assisted with Cursor using GPT-5.5 Made with [Cursor](https://cursor.com) Co-authored-by: Cursor <cursoragent@cursor.com>
|
Starting backport for target branches: 8.19, 9.3, 9.4 |
💔 All backports failed
Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation |
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
|
Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync. |
Closes elastic#259251 ## Summary - Pins Console HTTP method completion ordering with explicit `sortText` values so Monaco does not fall back to alphabetical label sorting. - Keeps the existing method set unchanged while ordering `GET` first and `DELETE` last. ## Root Cause - Monaco uses `sortText` for completion ordering and falls back to the item label when `sortText` is missing, which can put `DELETE` before safer/default verbs. ## Fix - Assign stable `sortText` values to method completion items based on the intended canonical order. - Add a focused unit test that sorts method suggestions the same way and verifies `GET` is first and `DELETE` is last. ## Before <img width="723" height="466" alt="image" src="https://github.com/user-attachments/assets/faf244b2-4207-483b-acbc-32b148441b18" /> ## After <img width="725" height="437" alt="image" src="https://github.com/user-attachments/assets/782c0c60-6052-4c28-80bc-f45403fa1383" /> ## Test Plan - `node scripts/jest --config=src/platform/plugins/shared/console/jest.config.js src/platform/plugins/shared/console/public/application/containers/editor/monaco_editor_actions_provider.test.ts` — passed. - `node scripts/check_changes.ts` — passed. ## Release Note - Fixes Console autocomplete so `GET` is shown before `DELETE` when suggesting HTTP methods on an empty request line. Assisted with Cursor using GPT-5.5 Made with [Cursor](https://cursor.com) Co-authored-by: Cursor <cursoragent@cursor.com> (cherry picked from commit 8849fcf) # Conflicts: # src/platform/plugins/shared/console/public/application/containers/editor/monaco_editor_actions_provider.test.ts
Closes elastic#259251 ## Summary - Pins Console HTTP method completion ordering with explicit `sortText` values so Monaco does not fall back to alphabetical label sorting. - Keeps the existing method set unchanged while ordering `GET` first and `DELETE` last. ## Root Cause - Monaco uses `sortText` for completion ordering and falls back to the item label when `sortText` is missing, which can put `DELETE` before safer/default verbs. ## Fix - Assign stable `sortText` values to method completion items based on the intended canonical order. - Add a focused unit test that sorts method suggestions the same way and verifies `GET` is first and `DELETE` is last. ## Before <img width="723" height="466" alt="image" src="https://github.com/user-attachments/assets/faf244b2-4207-483b-acbc-32b148441b18" /> ## After <img width="725" height="437" alt="image" src="https://github.com/user-attachments/assets/782c0c60-6052-4c28-80bc-f45403fa1383" /> ## Test Plan - `node scripts/jest --config=src/platform/plugins/shared/console/jest.config.js src/platform/plugins/shared/console/public/application/containers/editor/monaco_editor_actions_provider.test.ts` — passed. - `node scripts/check_changes.ts` — passed. ## Release Note - Fixes Console autocomplete so `GET` is shown before `DELETE` when suggesting HTTP methods on an empty request line. Assisted with Cursor using GPT-5.5 Made with [Cursor](https://cursor.com) Co-authored-by: Cursor <cursoragent@cursor.com> (cherry picked from commit 8849fcf) # Conflicts: # src/platform/plugins/shared/console/public/application/containers/editor/monaco_editor_actions_provider.test.ts
# Backport This will backport the following commits from `main` to `9.4`: - [[Console] Fix method suggestion order (#270787)](#270787) <!--- Backport version: 11.0.2 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Karen Grigoryan","email":"karen.grigoryan@elastic.co"},"sourceCommit":{"committedDate":"2026-05-26T13:22:04Z","message":"[Console] Fix method suggestion order (#270787)\n\nCloses #259251\n\n## Summary\n\n- Pins Console HTTP method completion ordering with explicit `sortText`\nvalues so Monaco does not fall back to alphabetical label sorting.\n- Keeps the existing method set unchanged while ordering `GET` first and\n`DELETE` last.\n\n## Root Cause\n\n- Monaco uses `sortText` for completion ordering and falls back to the\nitem label when `sortText` is missing, which can put `DELETE` before\nsafer/default verbs.\n\n## Fix\n\n- Assign stable `sortText` values to method completion items based on\nthe intended canonical order.\n- Add a focused unit test that sorts method suggestions the same way and\nverifies `GET` is first and `DELETE` is last.\n\n## Before\n<img width=\"723\" height=\"466\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/faf244b2-4207-483b-acbc-32b148441b18\"\n/>\n\n## After\n<img width=\"725\" height=\"437\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/782c0c60-6052-4c28-80bc-f45403fa1383\"\n/>\n\n## Test Plan\n\n- `node scripts/jest\n--config=src/platform/plugins/shared/console/jest.config.js\nsrc/platform/plugins/shared/console/public/application/containers/editor/monaco_editor_actions_provider.test.ts`\n— passed.\n- `node scripts/check_changes.ts` — passed.\n\n## Release Note\n\n- Fixes Console autocomplete so `GET` is shown before `DELETE` when\nsuggesting HTTP methods on an empty request line.\n\nAssisted with Cursor using GPT-5.5\n\nMade with [Cursor](https://cursor.com)\n\nCo-authored-by: Cursor <cursoragent@cursor.com>","sha":"8849fcf6623fc7d917db93caba0c18d5e8f16b34","branchLabelMapping":{"^v9.5.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Console","release_note:fix","Team:Kibana Management","backport:all-open","reviewer:claude","v9.5.0","reviewer:codex"],"title":"[Console] Fix method suggestion order","number":270787,"url":"https://github.com/elastic/kibana/pull/270787","mergeCommit":{"message":"[Console] Fix method suggestion order (#270787)\n\nCloses #259251\n\n## Summary\n\n- Pins Console HTTP method completion ordering with explicit `sortText`\nvalues so Monaco does not fall back to alphabetical label sorting.\n- Keeps the existing method set unchanged while ordering `GET` first and\n`DELETE` last.\n\n## Root Cause\n\n- Monaco uses `sortText` for completion ordering and falls back to the\nitem label when `sortText` is missing, which can put `DELETE` before\nsafer/default verbs.\n\n## Fix\n\n- Assign stable `sortText` values to method completion items based on\nthe intended canonical order.\n- Add a focused unit test that sorts method suggestions the same way and\nverifies `GET` is first and `DELETE` is last.\n\n## Before\n<img width=\"723\" height=\"466\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/faf244b2-4207-483b-acbc-32b148441b18\"\n/>\n\n## After\n<img width=\"725\" height=\"437\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/782c0c60-6052-4c28-80bc-f45403fa1383\"\n/>\n\n## Test Plan\n\n- `node scripts/jest\n--config=src/platform/plugins/shared/console/jest.config.js\nsrc/platform/plugins/shared/console/public/application/containers/editor/monaco_editor_actions_provider.test.ts`\n— passed.\n- `node scripts/check_changes.ts` — passed.\n\n## Release Note\n\n- Fixes Console autocomplete so `GET` is shown before `DELETE` when\nsuggesting HTTP methods on an empty request line.\n\nAssisted with Cursor using GPT-5.5\n\nMade with [Cursor](https://cursor.com)\n\nCo-authored-by: Cursor <cursoragent@cursor.com>","sha":"8849fcf6623fc7d917db93caba0c18d5e8f16b34"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.5.0","branchLabelMappingKey":"^v9.5.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/270787","number":270787,"mergeCommit":{"message":"[Console] Fix method suggestion order (#270787)\n\nCloses #259251\n\n## Summary\n\n- Pins Console HTTP method completion ordering with explicit `sortText`\nvalues so Monaco does not fall back to alphabetical label sorting.\n- Keeps the existing method set unchanged while ordering `GET` first and\n`DELETE` last.\n\n## Root Cause\n\n- Monaco uses `sortText` for completion ordering and falls back to the\nitem label when `sortText` is missing, which can put `DELETE` before\nsafer/default verbs.\n\n## Fix\n\n- Assign stable `sortText` values to method completion items based on\nthe intended canonical order.\n- Add a focused unit test that sorts method suggestions the same way and\nverifies `GET` is first and `DELETE` is last.\n\n## Before\n<img width=\"723\" height=\"466\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/faf244b2-4207-483b-acbc-32b148441b18\"\n/>\n\n## After\n<img width=\"725\" height=\"437\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/782c0c60-6052-4c28-80bc-f45403fa1383\"\n/>\n\n## Test Plan\n\n- `node scripts/jest\n--config=src/platform/plugins/shared/console/jest.config.js\nsrc/platform/plugins/shared/console/public/application/containers/editor/monaco_editor_actions_provider.test.ts`\n— passed.\n- `node scripts/check_changes.ts` — passed.\n\n## Release Note\n\n- Fixes Console autocomplete so `GET` is shown before `DELETE` when\nsuggesting HTTP methods on an empty request line.\n\nAssisted with Cursor using GPT-5.5\n\nMade with [Cursor](https://cursor.com)\n\nCo-authored-by: Cursor <cursoragent@cursor.com>","sha":"8849fcf6623fc7d917db93caba0c18d5e8f16b34"}}]}] BACKPORT-->
# Backport This will backport the following commits from `main` to `9.3`: - [[Console] Fix method suggestion order (#270787)](#270787) <!--- Backport version: 11.0.2 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Karen Grigoryan","email":"karen.grigoryan@elastic.co"},"sourceCommit":{"committedDate":"2026-05-26T13:22:04Z","message":"[Console] Fix method suggestion order (#270787)\n\nCloses #259251\n\n## Summary\n\n- Pins Console HTTP method completion ordering with explicit `sortText`\nvalues so Monaco does not fall back to alphabetical label sorting.\n- Keeps the existing method set unchanged while ordering `GET` first and\n`DELETE` last.\n\n## Root Cause\n\n- Monaco uses `sortText` for completion ordering and falls back to the\nitem label when `sortText` is missing, which can put `DELETE` before\nsafer/default verbs.\n\n## Fix\n\n- Assign stable `sortText` values to method completion items based on\nthe intended canonical order.\n- Add a focused unit test that sorts method suggestions the same way and\nverifies `GET` is first and `DELETE` is last.\n\n## Before\n<img width=\"723\" height=\"466\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/faf244b2-4207-483b-acbc-32b148441b18\"\n/>\n\n## After\n<img width=\"725\" height=\"437\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/782c0c60-6052-4c28-80bc-f45403fa1383\"\n/>\n\n## Test Plan\n\n- `node scripts/jest\n--config=src/platform/plugins/shared/console/jest.config.js\nsrc/platform/plugins/shared/console/public/application/containers/editor/monaco_editor_actions_provider.test.ts`\n— passed.\n- `node scripts/check_changes.ts` — passed.\n\n## Release Note\n\n- Fixes Console autocomplete so `GET` is shown before `DELETE` when\nsuggesting HTTP methods on an empty request line.\n\nAssisted with Cursor using GPT-5.5\n\nMade with [Cursor](https://cursor.com)\n\nCo-authored-by: Cursor <cursoragent@cursor.com>","sha":"8849fcf6623fc7d917db93caba0c18d5e8f16b34","branchLabelMapping":{"^v9.5.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Console","release_note:fix","Team:Kibana Management","backport:all-open","reviewer:claude","v9.5.0","reviewer:codex"],"title":"[Console] Fix method suggestion order","number":270787,"url":"https://github.com/elastic/kibana/pull/270787","mergeCommit":{"message":"[Console] Fix method suggestion order (#270787)\n\nCloses #259251\n\n## Summary\n\n- Pins Console HTTP method completion ordering with explicit `sortText`\nvalues so Monaco does not fall back to alphabetical label sorting.\n- Keeps the existing method set unchanged while ordering `GET` first and\n`DELETE` last.\n\n## Root Cause\n\n- Monaco uses `sortText` for completion ordering and falls back to the\nitem label when `sortText` is missing, which can put `DELETE` before\nsafer/default verbs.\n\n## Fix\n\n- Assign stable `sortText` values to method completion items based on\nthe intended canonical order.\n- Add a focused unit test that sorts method suggestions the same way and\nverifies `GET` is first and `DELETE` is last.\n\n## Before\n<img width=\"723\" height=\"466\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/faf244b2-4207-483b-acbc-32b148441b18\"\n/>\n\n## After\n<img width=\"725\" height=\"437\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/782c0c60-6052-4c28-80bc-f45403fa1383\"\n/>\n\n## Test Plan\n\n- `node scripts/jest\n--config=src/platform/plugins/shared/console/jest.config.js\nsrc/platform/plugins/shared/console/public/application/containers/editor/monaco_editor_actions_provider.test.ts`\n— passed.\n- `node scripts/check_changes.ts` — passed.\n\n## Release Note\n\n- Fixes Console autocomplete so `GET` is shown before `DELETE` when\nsuggesting HTTP methods on an empty request line.\n\nAssisted with Cursor using GPT-5.5\n\nMade with [Cursor](https://cursor.com)\n\nCo-authored-by: Cursor <cursoragent@cursor.com>","sha":"8849fcf6623fc7d917db93caba0c18d5e8f16b34"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.5.0","branchLabelMappingKey":"^v9.5.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/270787","number":270787,"mergeCommit":{"message":"[Console] Fix method suggestion order (#270787)\n\nCloses #259251\n\n## Summary\n\n- Pins Console HTTP method completion ordering with explicit `sortText`\nvalues so Monaco does not fall back to alphabetical label sorting.\n- Keeps the existing method set unchanged while ordering `GET` first and\n`DELETE` last.\n\n## Root Cause\n\n- Monaco uses `sortText` for completion ordering and falls back to the\nitem label when `sortText` is missing, which can put `DELETE` before\nsafer/default verbs.\n\n## Fix\n\n- Assign stable `sortText` values to method completion items based on\nthe intended canonical order.\n- Add a focused unit test that sorts method suggestions the same way and\nverifies `GET` is first and `DELETE` is last.\n\n## Before\n<img width=\"723\" height=\"466\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/faf244b2-4207-483b-acbc-32b148441b18\"\n/>\n\n## After\n<img width=\"725\" height=\"437\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/782c0c60-6052-4c28-80bc-f45403fa1383\"\n/>\n\n## Test Plan\n\n- `node scripts/jest\n--config=src/platform/plugins/shared/console/jest.config.js\nsrc/platform/plugins/shared/console/public/application/containers/editor/monaco_editor_actions_provider.test.ts`\n— passed.\n- `node scripts/check_changes.ts` — passed.\n\n## Release Note\n\n- Fixes Console autocomplete so `GET` is shown before `DELETE` when\nsuggesting HTTP methods on an empty request line.\n\nAssisted with Cursor using GPT-5.5\n\nMade with [Cursor](https://cursor.com)\n\nCo-authored-by: Cursor <cursoragent@cursor.com>","sha":"8849fcf6623fc7d917db93caba0c18d5e8f16b34"}}]}] BACKPORT-->
The console autocomplete FTR suite is active on 8.19 (describe.skip on main/9.x), so the new sortText-based ordering from elastic#270787 made the stale HTTP methods assertion fail. Update the expected P* order to match the pinned order (POST, PUT, PATCH). Co-authored-by: Cursor <cursoragent@cursor.com>
# Backport This will backport the following commits from `main` to `8.19`: - [[Console] Fix method suggestion order (#270787)](#270787) <!--- Backport version: 11.0.2 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Karen Grigoryan","email":"karen.grigoryan@elastic.co"},"sourceCommit":{"committedDate":"2026-05-26T13:22:04Z","message":"[Console] Fix method suggestion order (#270787)\n\nCloses #259251\n\n## Summary\n\n- Pins Console HTTP method completion ordering with explicit `sortText`\nvalues so Monaco does not fall back to alphabetical label sorting.\n- Keeps the existing method set unchanged while ordering `GET` first and\n`DELETE` last.\n\n## Root Cause\n\n- Monaco uses `sortText` for completion ordering and falls back to the\nitem label when `sortText` is missing, which can put `DELETE` before\nsafer/default verbs.\n\n## Fix\n\n- Assign stable `sortText` values to method completion items based on\nthe intended canonical order.\n- Add a focused unit test that sorts method suggestions the same way and\nverifies `GET` is first and `DELETE` is last.\n\n## Before\n<img width=\"723\" height=\"466\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/faf244b2-4207-483b-acbc-32b148441b18\"\n/>\n\n## After\n<img width=\"725\" height=\"437\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/782c0c60-6052-4c28-80bc-f45403fa1383\"\n/>\n\n## Test Plan\n\n- `node scripts/jest\n--config=src/platform/plugins/shared/console/jest.config.js\nsrc/platform/plugins/shared/console/public/application/containers/editor/monaco_editor_actions_provider.test.ts`\n— passed.\n- `node scripts/check_changes.ts` — passed.\n\n## Release Note\n\n- Fixes Console autocomplete so `GET` is shown before `DELETE` when\nsuggesting HTTP methods on an empty request line.\n\nAssisted with Cursor using GPT-5.5\n\nMade with [Cursor](https://cursor.com)\n\nCo-authored-by: Cursor <cursoragent@cursor.com>","sha":"8849fcf6623fc7d917db93caba0c18d5e8f16b34","branchLabelMapping":{"^v9.5.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Console","release_note:fix","Team:Kibana Management","backport:all-open","reviewer:claude","v9.5.0","reviewer:codex"],"title":"[Console] Fix method suggestion order","number":270787,"url":"https://github.com/elastic/kibana/pull/270787","mergeCommit":{"message":"[Console] Fix method suggestion order (#270787)\n\nCloses #259251\n\n## Summary\n\n- Pins Console HTTP method completion ordering with explicit `sortText`\nvalues so Monaco does not fall back to alphabetical label sorting.\n- Keeps the existing method set unchanged while ordering `GET` first and\n`DELETE` last.\n\n## Root Cause\n\n- Monaco uses `sortText` for completion ordering and falls back to the\nitem label when `sortText` is missing, which can put `DELETE` before\nsafer/default verbs.\n\n## Fix\n\n- Assign stable `sortText` values to method completion items based on\nthe intended canonical order.\n- Add a focused unit test that sorts method suggestions the same way and\nverifies `GET` is first and `DELETE` is last.\n\n## Before\n<img width=\"723\" height=\"466\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/faf244b2-4207-483b-acbc-32b148441b18\"\n/>\n\n## After\n<img width=\"725\" height=\"437\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/782c0c60-6052-4c28-80bc-f45403fa1383\"\n/>\n\n## Test Plan\n\n- `node scripts/jest\n--config=src/platform/plugins/shared/console/jest.config.js\nsrc/platform/plugins/shared/console/public/application/containers/editor/monaco_editor_actions_provider.test.ts`\n— passed.\n- `node scripts/check_changes.ts` — passed.\n\n## Release Note\n\n- Fixes Console autocomplete so `GET` is shown before `DELETE` when\nsuggesting HTTP methods on an empty request line.\n\nAssisted with Cursor using GPT-5.5\n\nMade with [Cursor](https://cursor.com)\n\nCo-authored-by: Cursor <cursoragent@cursor.com>","sha":"8849fcf6623fc7d917db93caba0c18d5e8f16b34"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.5.0","branchLabelMappingKey":"^v9.5.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/270787","number":270787,"mergeCommit":{"message":"[Console] Fix method suggestion order (#270787)\n\nCloses #259251\n\n## Summary\n\n- Pins Console HTTP method completion ordering with explicit `sortText`\nvalues so Monaco does not fall back to alphabetical label sorting.\n- Keeps the existing method set unchanged while ordering `GET` first and\n`DELETE` last.\n\n## Root Cause\n\n- Monaco uses `sortText` for completion ordering and falls back to the\nitem label when `sortText` is missing, which can put `DELETE` before\nsafer/default verbs.\n\n## Fix\n\n- Assign stable `sortText` values to method completion items based on\nthe intended canonical order.\n- Add a focused unit test that sorts method suggestions the same way and\nverifies `GET` is first and `DELETE` is last.\n\n## Before\n<img width=\"723\" height=\"466\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/faf244b2-4207-483b-acbc-32b148441b18\"\n/>\n\n## After\n<img width=\"725\" height=\"437\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/782c0c60-6052-4c28-80bc-f45403fa1383\"\n/>\n\n## Test Plan\n\n- `node scripts/jest\n--config=src/platform/plugins/shared/console/jest.config.js\nsrc/platform/plugins/shared/console/public/application/containers/editor/monaco_editor_actions_provider.test.ts`\n— passed.\n- `node scripts/check_changes.ts` — passed.\n\n## Release Note\n\n- Fixes Console autocomplete so `GET` is shown before `DELETE` when\nsuggesting HTTP methods on an empty request line.\n\nAssisted with Cursor using GPT-5.5\n\nMade with [Cursor](https://cursor.com)\n\nCo-authored-by: Cursor <cursoragent@cursor.com>","sha":"8849fcf6623fc7d917db93caba0c18d5e8f16b34"}}]}] BACKPORT--> --------- Co-authored-by: Cursor <cursoragent@cursor.com>
Closes #259251
Summary
sortTextvalues so Monaco does not fall back to alphabetical label sorting.GETfirst andDELETElast.Root Cause
sortTextfor completion ordering and falls back to the item label whensortTextis missing, which can putDELETEbefore safer/default verbs.Fix
sortTextvalues to method completion items based on the intended canonical order.GETis first andDELETEis last.Before
After
Test Plan
node scripts/jest --config=src/platform/plugins/shared/console/jest.config.js src/platform/plugins/shared/console/public/application/containers/editor/monaco_editor_actions_provider.test.ts— passed.node scripts/check_changes.ts— passed.Release Note
GETis shown beforeDELETEwhen suggesting HTTP methods on an empty request line.Assisted with Cursor using GPT-5.5
Made with Cursor